@import (reference) './_vars.less';
@import (reference) './_mixin.less';

.article {
    padding-bottom: 42px;

    .article-date {
        float: left;
        display: block;
    }
    .article-tag-list {
        float: left;
        margin-left: 32px;
    }
    .article-more-link {
        margin-bottom: 30px;
    }
    .video-container {
        margin-bottom: 16px;
        overflow: hidden;
        position: relative;
        width:100%;

        &::after {
            padding-top: 56.25%;
            display: block;
            content: '';
        }
        iframe {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }
    }
}
.article-header {
    h1 {
        font-size: 2em;
        font-weight: normal;

        a {
            color: @color-primary;
            color: var(--color-primary);
            .transition(all 0.3s ease);

            &:hover {
                color: @color-link-hover;
                color: var(--color-link-hover);
            }
        }
    }
}
.article-meta {
    padding-top: 8px;
    font-size: 14px;
}
.article-date {
    color: @color-muted;
    color: var(--color-muted);

    &:hover {
        color: @color-primary;
        color: var(--color-primary);
    }

    time {
        margin-left: 6px;
    }
}
.article-tag-list {
    color: @color-muted;
    color: var(--color-muted);
    list-style-type: none;
    overflow: hidden;
}
.article-tag-link {
    margin-left: 6px;
    color: @color-muted;
    color: var(--color-muted);
    vertical-align: middle;

    &:hover {
        color: @color-primary;
        color: var(--color-primary);
    }
}

.article-body {
    margin-top: 20px;
}

.article-more-link {
    text-align: right;

    a {
        display: inline-block;
        padding: 6px 12px;
        color: @color-muted;
        color: var(--color-muted);
        font-size: 14px;
        line-height: 1;
        border: 1px solid @color-border;
        border: 1px solid var(--color-border);
        border-radius: 4px;
        .transition(all 0.3s ease);

        &:hover {
            background-color: @color-hover;
            background-color: var(--color-hover);
            text-decoration: none;
        }
    }
}

.toc {
    padding: 20px 0;
    font-size: 15px;
    line-height: 18px;
    list-style-type: none;

    ol {
        padding-left: 20px;
        list-style-type: none;
    }
}
.toc-item {
    &.active {
        > .toc-link {
            color: @color-secondary;
            color: var(--color-secondary);
            background-color: @color-active;
            background-color: var(--color-active);

            &:before {
                display: block\9;
                .transform(scale(1));
            }
        }
    }
}
.toc-link {
    .flexbox();

    display: block\9;
    position: relative;
    padding: 5px 15px;
    color: @color-secondary;
    color: var(--color-secondary);

    &:before {
        position: absolute;
        top: 0;
        right: 0;
        content: '';
        width: 2px;
        height: 100%;
        line-height: 0;
        font-size: 0;
        background-color: @color-primary;
        background-color: var(--color-primary);
        display: none\9;
        .transform(scale(0));
        .transition(transform 0.3s ease);
    }
    &:hover {
        background-color: @color-hover;
        background-color: var(--color-hover);
    }
}
.toc-child {
    margin-top: 1px;
}
.toc-number {
    .flex-grow(0);
    .flex-shrink(0);

    padding-right: 6px;
    color: @color-muted;
    color: var(--color-muted);
    font-style: italic;
}
.toc-text {
    .flex-grow(1);
    .flex-shrink(1);
}

@link-size: 40px;
.article-prev,
.article-next {
    display: block;
    width: @link-size;
    height: @link-size;
    line-height: @link-size;
    text-align: center;
    color: @color-secondary;
    color: var(--color-secondary);
    font-size: 42px;

    &:hover {
        color: @color-primary;
        color: var(--color-primary);
    }
}
.article-next {
    float: right;
}

@media screen and (max-width: @size-mobile-screen-width) {
    .article-meta {
        font-size: 13px;
    }
    .article-tag-link {
        margin-right: 0;
        margin-left: 0;
    }
    .article {
        padding-bottom: 0;

        .article-date {
            float: none;
        }
        .article-tag-list {
            float: none;
            margin-left: 0;
            margin-top: 8px;
        }
    }
    .article-more-link a {
        padding: 4px 12px;
        font-size: 13px;
    }
}
